<%--
  Created by IntelliJ IDEA.
  User: taohj
  Date: 2014/10/8
  Time: 16:11
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>



    <script type="text/javascript">








        $(function () {


            var init=function(param){

                $.post("/admin/reports/getVisitsStatistics",param,function(result){


                    var categories=new Array();
                    var data=new Array();

                    for(var i=0;i<result.length; i++){
                        categories[i]=result[i].name;
                        data[i]=parseInt(result[i].total);
                    }

                    console.info(data);


                    $('#container_visits').highcharts({
                        title: {
                            text: '用户访问量统计分析',
                            x: -20 //center

                        },
                        subtitle: {
                            text: ' ',
                            x: -20
                        },
                        xAxis: {
                            categories: categories
                        },


                        series: [{
                            name: ' ',
                            data: data
                        }]
                    });


                },'json');


            };


            $(init({}));




            var form=$("#container_visits_form");
            form.find("a[value='统计']").on('click',function(){
                 var param=util.serializeObject(form);
                 init(param);
            });
        });


    </script>



<div style="padding-top: 30px;padding-left:  20px;">

    <form id="container_visits_form">
        <table>
            <tr>
                <td>开始时间</td>
                <td><input name="starttime" class="easyui-datebox" value="${requestScope.param.starttime}"></td>
                <td width="10"></td>
                <td>结束时间</td>
                <td><input name="endtime" class="easyui-datebox" value="${requestScope.param.endtime}"></td>
                <td width="10"></td>
                <td>最小单位</td>
                <td>
                    <select class="easyui-combobox" name="type">
                        <option value="1">年</option>
                        <option value="2">月</option>
                        <option value="3" selected>日</option>
                        <option value="4">时</option>
                    </select>
                </td>
                <td width="10"></td>
                <td>
                    <a class="easyui-linkbutton" value="统计" style="width: 40px;">统计</a>
                </td>
            </tr>
        </table>
    </form>

</div>

<div id="container_visits" style="width: auto;height: 560px;"></div>


